package cn.com.zero.file.config.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;

/**
 * @author liuxh
 * @version 1.0.0
 * @Description 文件上传配置类
 * @createTime 2023/2/28 17:34
 */
@Configuration
@Validated
@ConfigurationProperties(prefix = "zero.file", ignoreUnknownFields = false)
public class FileUploadProperties {

    /**
     * 文件服务类型
     */
    @NotEmpty
    private String type;

    /**
     * 允许上传的文件扩展名
     */
    @NotEmpty
    private String[] allowedExtension;

    /**
     * 允许上传的图片扩展名
     */
    private String[] imageExtension = {"bmp", "png", "gif", "jpg", "jpeg"};

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String[] getAllowedExtension() {
        return allowedExtension;
    }

    public void setAllowedExtension(String[] allowedExtension) {
        this.allowedExtension = allowedExtension;
    }

    public String[] getImageExtension() {
        return imageExtension;
    }

    public void setImageExtension(String[] imageExtension) {
        this.imageExtension = imageExtension;
    }
}
